From 356ba514a3cfc4a11c031fdce4c6bb81c4ed5ae3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 15 May 1993 19:00:34 +0000 Subject: [PATCH] (Fx_selection_exists_p): Handle nil, t as SELECTION arg. Don't die if SELECTION is not recognized. --- src/xselect.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xselect.c b/src/xselect.c index bb052ae1ccf..ca756646cd0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1679,12 +1679,18 @@ and t is the same as `SECONDARY'.)") Lisp_Object selection; { Window owner; + Atom atom; Display *dpy = x_current_display; CHECK_SYMBOL (selection, 0); if (!NILP (Fx_selection_owner_p (selection))) return Qt; + if (EQ (selection, Qnil)) selection = QPRIMARY; + if (EQ (selection, Qt)) selection = QSECONDARY; + atom = symbol_to_x_atom (dpy, selection); + if (atom == 0) + return Qnil; BLOCK_INPUT; - owner = XGetSelectionOwner (dpy, symbol_to_x_atom (dpy, selection)); + owner = XGetSelectionOwner (dpy, atom); UNBLOCK_INPUT; return (owner ? Qt : Qnil); } -- 2.30.2